package com.seata.demo.service.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.seata.demo.util.dto.CommodityDTO;
import com.seata.demo.util.res.Resp;

/**
* @comments
* @author  zg
* @date 2021年2月9日
*/
@FeignClient(name = "storage")
@RequestMapping("/storage/rest-service")
public interface StorageServiceClient {
    
    /**
     * 调用storage服务-扣减商品库存
     * @author zg
     * @date 2021年2月9日 
     * @param commodityCode
     * @param deductCount
     * @return
     */
    @PostMapping("/deduct-inventory")
    public Resp<CommodityDTO> deductInventory(@RequestParam String commodityCode, @RequestParam int deductCount);
    
}
